<template>
  <n-card class="cardbg" content-style="padding:0.75rem;">
    <template v-if="$cfg.function.ckqx('idc') == true">
      <span>注意：此功能是更新目录所有攻略，单个攻略请选择编辑攻略内容。</span>
      <!-- 攻略作者 -->
      <n-h3 class="h3title1">目录名称：</n-h3>
      <n-input placeholder="获取中..." v-model:value="val.data.n_dir_upd"></n-input>
      <n-h3 class="h3title1">排序：(数字越大越靠前)</n-h3>
      <n-input placeholder="获取中..." v-model:value="val.data.dir_px_upd"></n-input>
      <n-hr />
      <n-button @click="ct.upd_dir_info(val.data)">提交数据</n-button>
    </template>
    <template v-else>
      没有权限编辑，请使用相关用户组账号编辑。
      <n-hr />{{ $cfg.function.qxlang("idc") }}
    </template>
  </n-card>
</template>

<script>
export default {
  props: {
    val: {
      required: true,
    },
    ct: {
      required: true,
    },
  },
  setup(props) {
    let data = props.val;
    data['clickdata'].n_dir_upd = data['clickdata'].n_dir;
    data['clickdata'].dir_px_upd = data['clickdata'].dir_px;

    let val = reactive({
      data: {...data['clickdata']},
    });

    onMounted(async () => {
    });

    return {
      data,
      ct: props.ct,
      val,
    };
  },
};
</script>
